package start

import (
	"context"
	"github.com/redis/go-redis/v9"
	"log"
)

func InitCache() redis.Cmdable {
	opt := &redis.Options{
		Addr: "localhost:16379",
	}
	rdb := redis.NewClient(opt)
	ctx := context.Background()
	if err := rdb.Ping(ctx).Err(); err != nil {
		log.Fatalf("Could not connect to Redis: %s", err)
	}
	return rdb
}
